/*
* Copyright (C) 2010  Autodesk, Inc.
* 
* This library is free software; you can redistribute it and/or
* modify it under the terms of version 2.1 of the GNU Lesser
* General Public License as published by the Free Software Foundation.
* 
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* Lesser General Public License for more details.
* 
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*
*
*/

#include "stdafx.h"
#include "Fdo.h"
#include "mgOvBoundingBoxDefinition.h"
#include "WCS/Override/FdoWcsOvBoundingBoxDefinition.h"

NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvBoundingBoxDefinition::OvBoundingBoxDefinition(FdoWcsOvBoundingBoxDefinition* unmanagedObject)
{
    if (NULL == unmanagedObject) {
        throw gcnew Exception("unmanagedObject should not be NULL!");
    }
    UnmanagedObject = unmanagedObject;
}

NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvBoundingBoxDefinition::~OvBoundingBoxDefinition()
{
    delete UnmanagedObject;
}

FdoWcsOvBoundingBoxDefinition* NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvBoundingBoxDefinition::GetImpObj()
{
    return UnmanagedObject;
}

IntPtr NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvBoundingBoxDefinition::GetDisposableObject()
{
    return IntPtr(static_cast<FdoIDisposable*>(GetImpObj()));
}

String^ NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvBoundingBoxDefinition::CRS::get()
{
    FdoString* result;

    EXCEPTION_HANDLER(result = GetImpObj()->GetCRS())

    return CHECK_STRING(result);
}

System::Void NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvBoundingBoxDefinition::CRS::set(String^ value)
{
    EXCEPTION_HANDLER(GetImpObj()->SetCRS(StringToUni(value)))
}

double NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvBoundingBoxDefinition::MinX::get()
{
    return (double)GetImpObj()->GetMinX();
}

Void NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvBoundingBoxDefinition::MinX::set(double value)
{
    GetImpObj()->SetMinX((FdoDouble)value);
}

double NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvBoundingBoxDefinition::MinY::get()
{
    return (double)GetImpObj()->GetMinY();
}

Void NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvBoundingBoxDefinition::MinY::set(double value)
{
    GetImpObj()->SetMinY((FdoDouble)value);
}

double NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvBoundingBoxDefinition::MaxX::get()
{
    return (double)GetImpObj()->GetMaxX();
}

Void NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvBoundingBoxDefinition::MaxX::set(double value)
{
    GetImpObj()->SetMaxX((FdoDouble)value);
}

double NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvBoundingBoxDefinition::MaxY::get()
{
    return (double)GetImpObj()->GetMaxY();
}

Void NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvBoundingBoxDefinition::MaxY::set(double value)
{
    GetImpObj()->SetMaxY((FdoDouble)value);
}
